*
*
* Compton and Philips, "Does job insecurity shape policy preferences? An experimental manipulation of labor market risk"
* SI analysis file
* 3/16/23
*
*
* Required user-written programs: burd, coefplot
* ---------------------------------------------------------------------------
use "compton-philips-data.dta", clear
set seed 123737
set scheme burd, perm // use "findit scheme burd" if you don't have this

* Some global options:
global graphopts "mcolor(black) msymbol(T) ciopts(recast(rcap) lcolor(black))" 
global goptdem "mcolor(navy) msymbol(O) ciopts(recast(rcap) lcolor(black))"
global goptrep "mcolor(maroon) msymbol(T) ciopts(recast(rcap) lcolor(black))"
global goptind "mcolor(lavender) msymbol(S) ciopts(recast(rcap) lcolor(black))"

global gstyle1 "mcolor(navy) msymbol(O) ciopts(recast(rcap) lcolor(black))"
global gstyle2 "mcolor(maroon) msymbol(T) ciopts(recast(rcap) lcolor(black))"
global gstyle3 "mcolor(lavender) msymbol(S) ciopts(recast(rcap) lcolor(black))"
global gstyle4 "mcolor(ebblue) msymbol(D) ciopts(recast(rcap) lcolor(black))"
global gstyle5 "mcolor(dkgreen) msymbol(Sh) ciopts(recast(rcap) lcolor(black))"
global boots "vce(bootstrap, rep(1000) seed(123737))"





* ------ FIGURE 1A ----------
* diff = mean(Secure T) - mean(Control) 
reg jobinsecurity secure_minus_control if region_census == "NE", $boots
est sto secure_minus_control_ne
reg jobinsecurity secure_minus_control if region_census == "MW", $boots
est sto secure_minus_control_mw
reg jobinsecurity secure_minus_control if region_census == "SW", $boots
est sto secure_minus_control_sw
reg jobinsecurity secure_minus_control if region_census == "SE", $boots
est sto secure_minus_control_se
reg jobinsecurity secure_minus_control if region_census == "W", $boots
est sto secure_minus_control_w

* diff = mean(Insecure) - mean(Control) 
reg jobinsecurity insecure_minus_control if region_census == "NE", $boots
est sto insecure_minus_control_ne
reg jobinsecurity insecure_minus_control if region_census == "MW", $boots
est sto insecure_minus_control_mw
reg jobinsecurity insecure_minus_control if region_census == "SW", $boots
est sto insecure_minus_control_sw
reg jobinsecurity insecure_minus_control if region_census == "SE", $boots
est sto insecure_minus_control_se
reg jobinsecurity insecure_minus_control if region_census == "W", $boots
est sto insecure_minus_control_w

* diff = mean(Insecure) - mean(Secure T)
reg jobinsecurity insecure_minus_secure if region_census == "NE", $boots
est sto insecure_minus_secure_ne
reg jobinsecurity insecure_minus_secure if region_census == "MW", $boots
est sto insecure_minus_secure_mw
reg jobinsecurity insecure_minus_secure if region_census == "SW", $boots
est sto insecure_minus_secure_sw
reg jobinsecurity insecure_minus_secure if region_census == "SE", $boots
est sto insecure_minus_secure_se
reg jobinsecurity insecure_minus_secure if region_census == "W", $boots
est sto insecure_minus_secure_w

* PLOT
coefplot (secure_minus_control_ne, $gstyle1) ///
	(secure_minus_control_se, $gstyle2) ///
	(secure_minus_control_mw, $gstyle3) ///
	(secure_minus_control_sw, $gstyle4) ///
	(secure_minus_control_w, $gstyle5) ///
	(insecure_minus_control_ne, $gstyle1) ///
	(insecure_minus_control_se, $gstyle2) ///
	(insecure_minus_control_mw, $gstyle3) ///
	(insecure_minus_control_sw, $gstyle4) ///
	(insecure_minus_control_w, $gstyle5) ///
	(insecure_minus_secure_ne, $gstyle1) ///
	(insecure_minus_secure_se, $gstyle2) ///
	(insecure_minus_secure_mw, $gstyle3) ///
	(insecure_minus_secure_sw, $gstyle4) ///
	(insecure_minus_secure_w, $gstyle5) ///
	, drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Job Insecurity) legend(off)
graph export "SI-fig1a.pdf", as(pdf) replace // Note: Circle: Northeast, Triangle: Southeast, Solid Square: Midwest, Diamond: Southwest, Hollow Square: West.
* ---------------------------


* ------ FIGURE 1B ----------
est clear
* For change in UI benefits:
* diff = mean(Secure T) - mean(Control) 
reg benefit_pref secure_minus_control if region_census == "NE", $boots
est sto secure_minus_control_ne
reg benefit_pref secure_minus_control if region_census == "MW", $boots
est sto secure_minus_control_mw
reg benefit_pref secure_minus_control if region_census == "SW", $boots
est sto secure_minus_control_sw
reg benefit_pref secure_minus_control if region_census == "SE", $boots
est sto secure_minus_control_se
reg benefit_pref secure_minus_control if region_census == "W", $boots
est sto secure_minus_control_w

* diff = mean(Insecure) - mean(Control) 
reg benefit_pref insecure_minus_control if region_census == "NE", $boots
est sto insecure_minus_control_ne
reg benefit_pref insecure_minus_control if region_census == "MW", $boots
est sto insecure_minus_control_mw
reg benefit_pref insecure_minus_control if region_census == "SW", $boots
est sto insecure_minus_control_sw
reg benefit_pref insecure_minus_control if region_census == "SE", $boots
est sto insecure_minus_control_se
reg benefit_pref insecure_minus_control if region_census == "W", $boots
est sto insecure_minus_control_w

* diff = mean(Insecure) - mean(Secure T)
reg benefit_pref insecure_minus_secure if region_census == "NE", $boots
est sto insecure_minus_secure_ne
reg benefit_pref insecure_minus_secure if region_census == "MW", $boots
est sto insecure_minus_secure_mw
reg benefit_pref insecure_minus_secure if region_census == "SW", $boots
est sto insecure_minus_secure_sw
reg benefit_pref insecure_minus_secure if region_census == "SE", $boots
est sto insecure_minus_secure_se
reg benefit_pref insecure_minus_secure if region_census == "W", $boots
est sto insecure_minus_secure_w

* PLOT
coefplot (secure_minus_control_ne, $gstyle1) ///
	(secure_minus_control_se, $gstyle2) ///
	(secure_minus_control_mw, $gstyle3) ///
	(secure_minus_control_sw, $gstyle4) ///
	(secure_minus_control_w, $gstyle5) ///
	(insecure_minus_control_ne, $gstyle1) ///
	(insecure_minus_control_se, $gstyle2) ///
	(insecure_minus_control_mw, $gstyle3) ///
	(insecure_minus_control_sw, $gstyle4) ///
	(insecure_minus_control_w, $gstyle5) ///
	(insecure_minus_secure_ne, $gstyle1) ///
	(insecure_minus_secure_se, $gstyle2) ///
	(insecure_minus_secure_mw, $gstyle3) ///
	(insecure_minus_secure_sw, $gstyle4) ///
	(insecure_minus_secure_w, $gstyle5), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in UI Benefits) legend(off)
graph export "SI-fig1b.pdf", as(pdf) replace // Note: Circle: Northeast, Triangle: Southeast, Solid Square: Midwest, Diamond: Southwest, Hollow Square: West.
* ---------------------------

* ------ FIGURE 1C ----------
est clear
* For change in duration eligibility:
* diff = mean(Secure T) - mean(Control) 
reg duration_pref secure_minus_control if region_census == "NE", $boots
est sto secure_minus_control_ne
reg duration_pref secure_minus_control if region_census == "MW", $boots
est sto secure_minus_control_mw
reg duration_pref secure_minus_control if region_census == "SW", $boots
est sto secure_minus_control_sw
reg duration_pref secure_minus_control if region_census == "SE", $boots
est sto secure_minus_control_se
reg duration_pref secure_minus_control if region_census == "W", $boots
est sto secure_minus_control_w

* diff = mean(Insecure) - mean(Control) 
reg duration_pref insecure_minus_control if region_census == "NE", $boots
est sto insecure_minus_control_ne
reg duration_pref insecure_minus_control if region_census == "MW", $boots
est sto insecure_minus_control_mw
reg duration_pref insecure_minus_control if region_census == "SW", $boots
est sto insecure_minus_control_sw
reg duration_pref insecure_minus_control if region_census == "SE", $boots
est sto insecure_minus_control_se
reg duration_pref insecure_minus_control if region_census == "W", $boots
est sto insecure_minus_control_w

* diff = mean(Insecure) - mean(Secure T)
reg duration_pref insecure_minus_secure if region_census == "NE", $boots
est sto insecure_minus_secure_ne
reg duration_pref insecure_minus_secure if region_census == "MW", $boots
est sto insecure_minus_secure_mw
reg duration_pref insecure_minus_secure if region_census == "SW", $boots
est sto insecure_minus_secure_sw
reg duration_pref insecure_minus_secure if region_census == "SE", $boots
est sto insecure_minus_secure_se
reg duration_pref insecure_minus_secure if region_census == "W", $boots
est sto insecure_minus_secure_w

* PLOT
coefplot (secure_minus_control_ne, $gstyle1) ///
	(secure_minus_control_se, $gstyle2) ///
	(secure_minus_control_mw, $gstyle3) ///
	(secure_minus_control_sw, $gstyle4) ///
	(secure_minus_control_w, $gstyle5) ///
	(insecure_minus_control_ne, $gstyle1) ///
	(insecure_minus_control_se, $gstyle2) ///
	(insecure_minus_control_mw, $gstyle3) ///
	(insecure_minus_control_sw, $gstyle4) ///
	(insecure_minus_control_w, $gstyle5) ///
	(insecure_minus_secure_ne, $gstyle1) ///
	(insecure_minus_secure_se, $gstyle2) ///
	(insecure_minus_secure_mw, $gstyle3) ///
	(insecure_minus_secure_sw, $gstyle4) ///
	(insecure_minus_secure_w, $gstyle5), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Duration Eligibility) legend(off)
graph export "SI-fig1c.pdf", as(pdf) replace // Note: Circle: Northeast, Triangle: Southeast, Solid Square: Midwest, Diamond: Southwest, Hollow Square: West.
* ---------------------------


* ------ FIGURE 1D ----------
est clear
* diff = mean(Secure T) - mean(Control) 
reg strict_pref secure_minus_control if region_census == "NE", $boots
est sto secure_minus_control_ne
reg strict_pref secure_minus_control if region_census == "MW", $boots
est sto secure_minus_control_mw
reg strict_pref secure_minus_control if region_census == "SW", $boots
est sto secure_minus_control_sw
reg strict_pref secure_minus_control if region_census == "SE", $boots
est sto secure_minus_control_se
reg strict_pref secure_minus_control if region_census == "W", $boots
est sto secure_minus_control_w

* diff = mean(Insecure) - mean(Control) 
reg strict_pref insecure_minus_control if region_census == "NE", $boots
est sto insecure_minus_control_ne
reg strict_pref insecure_minus_control if region_census == "MW", $boots
est sto insecure_minus_control_mw
reg strict_pref insecure_minus_control if region_census == "SW", $boots
est sto insecure_minus_control_sw
reg strict_pref insecure_minus_control if region_census == "SE", $boots
est sto insecure_minus_control_se
reg strict_pref insecure_minus_control if region_census == "W", $boots
est sto insecure_minus_control_w

* diff = mean(Insecure) - mean(Secure T)
reg strict_pref insecure_minus_secure if region_census == "NE", $boots
est sto insecure_minus_secure_ne
reg strict_pref insecure_minus_secure if region_census == "MW", $boots
est sto insecure_minus_secure_mw
reg strict_pref insecure_minus_secure if region_census == "SW", $boots
est sto insecure_minus_secure_sw
reg strict_pref insecure_minus_secure if region_census == "SE", $boots
est sto insecure_minus_secure_se
reg strict_pref insecure_minus_secure if region_census == "W", $boots
est sto insecure_minus_secure_w

* PLOT
coefplot (secure_minus_control_ne, $gstyle1) ///
	(secure_minus_control_se, $gstyle2) ///
	(secure_minus_control_mw, $gstyle3) ///
	(secure_minus_control_sw, $gstyle4) ///
	(secure_minus_control_w, $gstyle5) ///
	(insecure_minus_control_ne, $gstyle1) ///
	(insecure_minus_control_se, $gstyle2) ///
	(insecure_minus_control_mw, $gstyle3) ///
	(insecure_minus_control_sw, $gstyle4) ///
	(insecure_minus_control_w, $gstyle5) ///
	(insecure_minus_secure_ne, $gstyle1) ///
	(insecure_minus_secure_se, $gstyle2) ///
	(insecure_minus_secure_mw, $gstyle3) ///
	(insecure_minus_secure_sw, $gstyle4) ///
	(insecure_minus_secure_w, $gstyle5), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Restrictiveness Eligibility) legend(off)
graph export "SI-fig1d.pdf", as(pdf) replace // Note: Circle: Northeast, Triangle: Southeast, Solid Square: Midwest, Diamond: Southwest, Hollow Square: West.
* ---------------------------


* ------ FIGURE 2A ----------
est clear
* diff = mean(Secure T) - mean(Control) 
reg jobinsecurity secure_minus_control if rtw == 0, $boots
est sto secure_minus_control_0
reg jobinsecurity secure_minus_control if rtw == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg jobinsecurity insecure_minus_control if rtw == 0, $boots
est sto insecure_minus_control_0
reg jobinsecurity insecure_minus_control if rtw == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg jobinsecurity insecure_minus_secure if rtw == 0, $boots
est sto insecure_minus_secure_0
reg jobinsecurity insecure_minus_secure if rtw == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Job Insecurity) legend(off)
graph export "SI-fig2a.pdf", as(pdf) replace // Note: Circle: No RTW, Triangle: RTW.
* ---------------------------


* ------ FIGURE 2B ----------
est clear
* For change in UI benefits:
* diff = mean(Secure T) - mean(Control) 
reg benefit_pref secure_minus_control if rtw == 0, $boots
est sto secure_minus_control_0
reg benefit_pref secure_minus_control if rtw == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg benefit_pref insecure_minus_control if rtw == 0, $boots
est sto insecure_minus_control_0
reg benefit_pref insecure_minus_control if rtw == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg benefit_pref insecure_minus_secure if rtw == 0, $boots
est sto insecure_minus_secure_0
reg benefit_pref insecure_minus_secure if rtw == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in UI Benefits) legend(off)
graph export "SI-fig2b.pdf", as(pdf) replace // Note: Circle: No RTW, Triangle: RTW.
* ---------------------------


* ------ FIGURE 2C ----------
est clear
* For change in duration eligibility:
* diff = mean(Secure T) - mean(Control) 
reg duration_pref secure_minus_control if rtw == 0, $boots
est sto secure_minus_control_0
reg duration_pref secure_minus_control if rtw == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg duration_pref insecure_minus_control if rtw == 0, $boots
est sto insecure_minus_control_0
reg duration_pref insecure_minus_control if rtw == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg duration_pref insecure_minus_secure if rtw == 0, $boots
est sto insecure_minus_secure_0
reg duration_pref insecure_minus_secure if rtw == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Duration Eligibility) legend(off)
graph export "SI-fig2c.pdf", as(pdf) replace // Note: Circle: No RTW, Triangle: RTW.
* ---------------------------


* ------ FIGURE 2D ----------
est clear
* For change in restrictiveness eligibility:
* diff = mean(Secure T) - mean(Control) 
reg strict_pref secure_minus_control if rtw == 0, $boots
est sto secure_minus_control_0
reg strict_pref secure_minus_control if rtw == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg strict_pref insecure_minus_control if rtw == 0, $boots
est sto insecure_minus_control_0
reg strict_pref insecure_minus_control if rtw == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg strict_pref insecure_minus_secure if rtw == 0, $boots
est sto insecure_minus_secure_0
reg strict_pref insecure_minus_secure if rtw == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Restrictiveness Eligibility) legend(off)
graph export "SI-fig2d.pdf", as(pdf) replace // Note: Circle: No RTW, Triangle: RTW.
* ---------------------------


* ---------Figure 3A --------
est clear
* diff = mean(Secure T) - mean(Control) 
reg jobinsecurity secure_minus_control if ue_quart == 1, $boots
est sto secure_minus_control_1
reg jobinsecurity secure_minus_control if ue_quart == 2, $boots
est sto secure_minus_control_2
reg jobinsecurity secure_minus_control if ue_quart == 3, $boots
est sto secure_minus_control_3
reg jobinsecurity secure_minus_control if ue_quart == 4, $boots
est sto secure_minus_control_4

* diff = mean(Insecure) - mean(Control) 
reg jobinsecurity insecure_minus_control if ue_quart == 1, $boots
est sto insecure_minus_control_1
reg jobinsecurity insecure_minus_control if ue_quart == 2, $boots
est sto insecure_minus_control_2
reg jobinsecurity insecure_minus_control if ue_quart == 3, $boots
est sto insecure_minus_control_3
reg jobinsecurity insecure_minus_control if ue_quart == 4, $boots
est sto insecure_minus_control_4


* diff = mean(Insecure) - mean(Secure T)
reg jobinsecurity insecure_minus_secure if ue_quart == 1, $boots
est sto insecure_minus_secure_1
reg jobinsecurity insecure_minus_secure if ue_quart == 2, $boots
est sto insecure_minus_secure_2
reg jobinsecurity insecure_minus_secure if ue_quart == 3, $boots
est sto insecure_minus_secure_3
reg jobinsecurity insecure_minus_secure if ue_quart == 4, $boots
est sto insecure_minus_secure_4


* PLOT
coefplot (secure_minus_control_1, $gstyle1) ///
	(secure_minus_control_2, $gstyle2) ///
	(secure_minus_control_3, $gstyle3) ///
	(secure_minus_control_4, $gstyle4) ///
	(insecure_minus_control_1, $gstyle1) ///
	(insecure_minus_control_2, $gstyle2) ///
	(insecure_minus_control_3, $gstyle3) ///
	(insecure_minus_control_4, $gstyle4) ///
	(insecure_minus_secure_1, $gstyle1) ///
	(insecure_minus_secure_2, $gstyle2) ///
	(insecure_minus_secure_3, $gstyle3) ///
	(insecure_minus_secure_4, $gstyle4), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Job Insecurity) legend(off)
graph export "SI-fig3a.pdf", as(pdf) replace // Note: Circle: bottom quartile, Triangle: second quartile, Solid Square: third quartile, Diamond: top quartile.
* ---------------------------

* ---------Figure 3B --------
est clear
* For change in UI benefits:
* diff = mean(Secure T) - mean(Control) 
reg benefit_pref secure_minus_control if ue_quart == 1, $boots
est sto secure_minus_control_1
reg benefit_pref secure_minus_control if ue_quart == 2, $boots
est sto secure_minus_control_2
reg benefit_pref secure_minus_control if ue_quart == 3, $boots
est sto secure_minus_control_3
reg benefit_pref secure_minus_control if ue_quart == 4, $boots
est sto secure_minus_control_4

* diff = mean(Insecure) - mean(Control) 
reg benefit_pref insecure_minus_control if ue_quart == 1, $boots
est sto insecure_minus_control_1
reg benefit_pref insecure_minus_control if ue_quart == 2, $boots
est sto insecure_minus_control_2
reg benefit_pref insecure_minus_control if ue_quart == 3, $boots
est sto insecure_minus_control_3
reg benefit_pref insecure_minus_control if ue_quart == 4, $boots
est sto insecure_minus_control_4

* diff = mean(Insecure) - mean(Secure T)
reg benefit_pref insecure_minus_secure if ue_quart == 1, $boots
est sto insecure_minus_secure_1
reg benefit_pref insecure_minus_secure if ue_quart == 2, $boots
est sto insecure_minus_secure_2
reg benefit_pref insecure_minus_secure if ue_quart == 3, $boots
est sto insecure_minus_secure_3
reg benefit_pref insecure_minus_secure if ue_quart == 4, $boots
est sto insecure_minus_secure_4

* PLOT
coefplot (secure_minus_control_1, $gstyle1) ///
	(secure_minus_control_2, $gstyle2) ///
	(secure_minus_control_3, $gstyle3) ///
	(secure_minus_control_4, $gstyle4) ///
	(insecure_minus_control_1, $gstyle1) ///
	(insecure_minus_control_2, $gstyle2) ///
	(insecure_minus_control_3, $gstyle3) ///
	(insecure_minus_control_4, $gstyle4) ///
	(insecure_minus_secure_1, $gstyle1) ///
	(insecure_minus_secure_2, $gstyle2) ///
	(insecure_minus_secure_3, $gstyle3) ///
	(insecure_minus_secure_4, $gstyle4), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in UI Benefits) legend(off)
graph export "SI-fig3b.pdf", as(pdf) replace // Note: Circle: bottom quartile, Triangle: second quartile, Solid Square: third quartile, Diamond: top quartile.
* ---------------------------


* ---------Figure 3C --------
est clear
* For change in duration eligibility:
* diff = mean(Secure T) - mean(Control) 
reg duration_pref secure_minus_control if ue_quart == 1, $boots
est sto secure_minus_control_1
reg duration_pref secure_minus_control if ue_quart == 2, $boots
est sto secure_minus_control_2
reg duration_pref secure_minus_control if ue_quart == 3, $boots
est sto secure_minus_control_3
reg duration_pref secure_minus_control if ue_quart == 4, $boots
est sto secure_minus_control_4

* diff = mean(Insecure) - mean(Control) 
reg duration_pref insecure_minus_control if ue_quart == 1, $boots
est sto insecure_minus_control_1
reg duration_pref insecure_minus_control if ue_quart == 2, $boots
est sto insecure_minus_control_2
reg duration_pref insecure_minus_control if ue_quart == 3, $boots
est sto insecure_minus_control_3
reg duration_pref insecure_minus_control if ue_quart == 4, $boots
est sto insecure_minus_control_4

* diff = mean(Insecure) - mean(Secure T)
reg duration_pref insecure_minus_secure if ue_quart == 1, $boots
est sto insecure_minus_secure_1
reg duration_pref insecure_minus_secure if ue_quart == 2, $boots
est sto insecure_minus_secure_2
reg duration_pref insecure_minus_secure if ue_quart == 3, $boots
est sto insecure_minus_secure_3
reg duration_pref insecure_minus_secure if ue_quart == 4, $boots
est sto insecure_minus_secure_4

* PLOT
coefplot (secure_minus_control_1, $gstyle1) ///
	(secure_minus_control_2, $gstyle2) ///
	(secure_minus_control_3, $gstyle3) ///
	(secure_minus_control_4, $gstyle4) ///
	(insecure_minus_control_1, $gstyle1) ///
	(insecure_minus_control_2, $gstyle2) ///
	(insecure_minus_control_3, $gstyle3) ///
	(insecure_minus_control_4, $gstyle4) ///
	(insecure_minus_secure_1, $gstyle1) ///
	(insecure_minus_secure_2, $gstyle2) ///
	(insecure_minus_secure_3, $gstyle3) ///
	(insecure_minus_secure_4, $gstyle4), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Duration Eligibility) legend(off)
graph export "SI-fig3c.pdf", as(pdf) replace // Note: Circle: bottom quartile, Triangle: second quartile, Solid Square: third quartile, Diamond: top quartile.
* ---------------------------


* ---------Figure 3D --------
est clear
* For change in restrictiveness eligibility:
* diff = mean(Secure T) - mean(Control) 
reg strict_pref secure_minus_control if ue_quart == 1, $boots
est sto secure_minus_control_1
reg strict_pref secure_minus_control if ue_quart == 2, $boots
est sto secure_minus_control_2
reg strict_pref secure_minus_control if ue_quart == 3, $boots
est sto secure_minus_control_3
reg strict_pref secure_minus_control if ue_quart == 4, $boots
est sto secure_minus_control_4

* diff = mean(Insecure) - mean(Control) 
reg strict_pref insecure_minus_control if ue_quart == 1, $boots
est sto insecure_minus_control_1
reg strict_pref insecure_minus_control if ue_quart == 2, $boots
est sto insecure_minus_control_2
reg strict_pref insecure_minus_control if ue_quart == 3, $boots
est sto insecure_minus_control_3
reg strict_pref insecure_minus_control if ue_quart == 4, $boots
est sto insecure_minus_control_4

* diff = mean(Insecure) - mean(Secure T)
reg strict_pref insecure_minus_secure if ue_quart == 1, $boots
est sto insecure_minus_secure_1
reg strict_pref insecure_minus_secure if ue_quart == 2, $boots
est sto insecure_minus_secure_2
reg strict_pref insecure_minus_secure if ue_quart == 3, $boots
est sto insecure_minus_secure_3
reg strict_pref insecure_minus_secure if ue_quart == 4, $boots
est sto insecure_minus_secure_4

* PLOT
coefplot (secure_minus_control_1, $gstyle1) ///
	(secure_minus_control_2, $gstyle2) ///
	(secure_minus_control_3, $gstyle3) ///
	(secure_minus_control_4, $gstyle4) ///
	(insecure_minus_control_1, $gstyle1) ///
	(insecure_minus_control_2, $gstyle2) ///
	(insecure_minus_control_3, $gstyle3) ///
	(insecure_minus_control_4, $gstyle4) ///
	(insecure_minus_secure_1, $gstyle1) ///
	(insecure_minus_secure_2, $gstyle2) ///
	(insecure_minus_secure_3, $gstyle3) ///
	(insecure_minus_secure_4, $gstyle4), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Restrictiveness Eligibility) legend(off)
graph export "SI-fig3d.pdf", as(pdf) replace // Note: Circle: bottom quartile, Triangle: second quartile, Solid Square: third quartile, Diamond: top quartile.
* ---------------------------


* --- TABLE 1 ------------

* Female
bysort CUB4P05_wording: su female
ttest female if CUB4P05_wording != 3, by(CUB4P05_wording) // insecure vs control
ttest female if CUB4P05_wording != 2, by(CUB4P05_wording) // secure vs control

* Age
bysort CUB4P05_wording: su age
ttest age if CUB4P05_wording != 3, by(CUB4P05_wording) // insecure vs control
ttest age if CUB4P05_wording != 2, by(CUB4P05_wording) // secure vs control

* Republican
bysort CUB4P05_wording: su republican
ttest republican if CUB4P05_wording != 3, by(CUB4P05_wording) // insecure vs control
ttest republican if CUB4P05_wording != 2, by(CUB4P05_wording) // secure vs control

* Democrat
bysort CUB4P05_wording: su democrat
ttest democrat if CUB4P05_wording != 3, by(CUB4P05_wording) // insecure vs control
ttest democrat if CUB4P05_wording != 2, by(CUB4P05_wording) // secure vs control

* Catholic
bysort CUB4P05_wording: su catholic
ttest catholic if CUB4P05_wording != 3, by(CUB4P05_wording) // insecure vs control
ttest catholic if CUB4P05_wording != 2, by(CUB4P05_wording) // secure vs control

* Protestant
bysort CUB4P05_wording: su protestant
ttest protestant if CUB4P05_wording != 3, by(CUB4P05_wording) // insecure vs control
ttest protestant if CUB4P05_wording != 2, by(CUB4P05_wording) // secure vs control

* minority
bysort CUB4P05_wording: su minority
ttest minority if CUB4P05_wording != 3, by(CUB4P05_wording) // insecure vs control
ttest minority if CUB4P05_wording != 2, by(CUB4P05_wording) // secure vs control

* latinx
bysort CUB4P05_wording: su latinx
ttest latinx if CUB4P05_wording != 3, by(CUB4P05_wording) // insecure vs control
ttest latinx if CUB4P05_wording != 2, by(CUB4P05_wording) // secure vs control
* ---------------------------



* ----- FIGURE 4a ------------
est clear
* diff = mean(Secure T) - mean(Control) 
reg jobinsecurity secure_minus_control if employ == 1 | employ == 2, $boots
est sto secure_minus_control

* diff = mean(Insecure) - mean(Control) 
reg jobinsecurity insecure_minus_control  if employ == 1 | employ == 2, $boots 
est sto insecure_minus_control

* diff = mean(Insecure) - mean(Secure T)
lab var insecure_minus_secure "Insecure Relative to Secure"
reg jobinsecurity insecure_minus_secure  if employ == 1 | employ == 2, $boots 
est sto insecure_minus_secure

* PLOT
coefplot (secure_minus_control, $graphopts) ///
	(insecure_minus_control, $graphopts) ///
	(insecure_minus_secure, $graphopts), drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Job Insecurity) legend(off)
graph export "SI-fig4a.pdf", as(pdf) replace
* ---------------------------


* ----- FIGURE 4b ------------
est clear
* diff = mean(Secure T) - mean(Control) 
reg benefit_pref secure_minus_control if employ == 1 | employ == 2, $boots 
est sto secure_minus_control

* diff = mean(Insecure) - mean(Control) 
reg benefit_pref insecure_minus_control if employ == 1 | employ == 2, $boots 
est sto insecure_minus_control

* diff = mean(Insecure) - mean(Secure T)
reg benefit_pref insecure_minus_secure if employ == 1 | employ == 2, $boots 
est sto insecure_minus_secure

* PLOT
coefplot (secure_minus_control, $graphopts) ///
	(insecure_minus_control, $graphopts) ///
	(insecure_minus_secure, $graphopts), drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in UI Benefits) legend(off)
graph export "SI-fig4b.pdf", as(pdf) replace
* ---------------------------


* ----- FIGURE 4c ------------
est clear
* diff = mean(Secure T) - mean(Control) 
reg duration_pref secure_minus_control if employ == 1 | employ == 2, $boots 
est sto secure_minus_control

* diff = mean(Insecure) - mean(Control) 
reg duration_pref insecure_minus_control if employ == 1 | employ == 2, $boots 
est sto insecure_minus_control

* diff = mean(Insecure) - mean(Secure T)
reg duration_pref insecure_minus_secure if employ == 1 | employ == 2, $boots 
est sto insecure_minus_secure

* PLOT
coefplot (secure_minus_control, $graphopts) ///
	(insecure_minus_control, $graphopts) ///
	(insecure_minus_secure, $graphopts), drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Duration Eligibility) legend(off)
graph export "SI-fig4c.pdf", as(pdf) replace
* ---------------------------


* ----- FIGURE 4d ------------
est clear
* diff = mean(Secure T) - mean(Control) 
reg strict_pref secure_minus_control if employ == 1 | employ == 2, $boots 
est sto secure_minus_control

* diff = mean(Insecure) - mean(Control) 
reg strict_pref insecure_minus_control if employ == 1 | employ == 2, $boots 
est sto insecure_minus_control

* diff = mean(Insecure) - mean(Secure T)
reg strict_pref insecure_minus_secure if employ == 1 | employ == 2, $boots 
est sto insecure_minus_secure

* PLOT
coefplot (secure_minus_control, $graphopts) ///
	(insecure_minus_control, $graphopts) ///
	(insecure_minus_secure, $graphopts), drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Restrictiveness Eligibility) legend(off)
graph export "SI-fig4d.pdf", as(pdf) replace
* ---------------------------


* ----- FIGURE 5a ------------
est clear
* diff = mean(Secure T) - mean(Control) 
reg jobinsecurity secure_minus_control if female == 0, $boots
est sto secure_minus_control_0
reg jobinsecurity secure_minus_control if female == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg jobinsecurity insecure_minus_control if female == 0, $boots
est sto insecure_minus_control_0
reg jobinsecurity insecure_minus_control if female == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg jobinsecurity insecure_minus_secure if female == 0, $boots
est sto insecure_minus_secure_0
reg jobinsecurity insecure_minus_secure if female == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Job Insecurity) legend(off)
graph export "SI-fig5a.pdf", as(pdf) replace // Note: Circle: MALE, Triangle: FEMALE.
* ---------------------------


* ----- FIGURE 5b ------------
est clear
* For change in UI benefits:
* diff = mean(Secure T) - mean(Control) 
reg benefit_pref secure_minus_control if female == 0, $boots
est sto secure_minus_control_0
reg benefit_pref secure_minus_control if female == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg benefit_pref insecure_minus_control if female == 0, $boots
est sto insecure_minus_control_0
reg benefit_pref insecure_minus_control if female == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg benefit_pref insecure_minus_secure if female == 0, $boots
est sto insecure_minus_secure_0
reg benefit_pref insecure_minus_secure if female == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in UI Benefits) legend(off)
graph export "SI-fig5b.pdf", as(pdf) replace // Note:  Circle: MALE, Triangle: FEMALE.
* ---------------------------


* ----- FIGURE 5c ------------
est clear
* For change in duration eligibility:
* diff = mean(Secure T) - mean(Control) 
reg duration_pref secure_minus_control if female == 0, $boots
est sto secure_minus_control_0
reg duration_pref secure_minus_control if female == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg duration_pref insecure_minus_control if female == 0, $boots
est sto insecure_minus_control_0
reg duration_pref insecure_minus_control if female == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg duration_pref insecure_minus_secure if female == 0, $boots
est sto insecure_minus_secure_0
reg duration_pref insecure_minus_secure if female == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Duration Eligibility) legend(off)
graph export "SI-fig5c.pdf", as(pdf) replace // Note:  Circle: MALE, Triangle: FEMALE.
* ---------------------------


* ----- FIGURE 5d ------------
est clear
* For change in restrictiveness eligibility:
* diff = mean(Secure T) - mean(Control) 
reg strict_pref secure_minus_control if female == 0, $boots
est sto secure_minus_control_0
reg strict_pref secure_minus_control if female == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg strict_pref insecure_minus_control if female == 0, $boots
est sto insecure_minus_control_0
reg strict_pref insecure_minus_control if female == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg strict_pref insecure_minus_secure if female == 0, $boots
est sto insecure_minus_secure_0
reg strict_pref insecure_minus_secure if female == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Restrictiveness Eligibility) legend(off)
graph export "SI-fig5d.pdf", as(pdf) replace // Note:  Circle: MALE, Triangle: FEMALE.
* ---------------------------


* ----- FIGURE 6a ------------
est clear
* diff = mean(Secure T) - mean(Control) 
reg jobinsecurity secure_minus_control if bachelors == 0, $boots
est sto secure_minus_control_0
reg jobinsecurity secure_minus_control if bachelors == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg jobinsecurity insecure_minus_control if bachelors == 0, $boots
est sto insecure_minus_control_0
reg jobinsecurity insecure_minus_control if bachelors == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg jobinsecurity insecure_minus_secure if bachelors == 0, $boots
est sto insecure_minus_secure_0
reg jobinsecurity insecure_minus_secure if bachelors == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Job Insecurity) legend(off)
graph export "SI-fig6a.pdf", as(pdf) replace // Note: Circle: NO BACHELORS, Triangle: BACHELORS OR HIGHER.
* ---------------------------


* ----- FIGURE 6b ------------
est clear
* For change in UI benefits:
* diff = mean(Secure T) - mean(Control) 
reg benefit_pref secure_minus_control if bachelors == 0, $boots
est sto secure_minus_control_0
reg benefit_pref secure_minus_control if bachelors == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg benefit_pref insecure_minus_control if bachelors == 0, $boots
est sto insecure_minus_control_0
reg benefit_pref insecure_minus_control if bachelors == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg benefit_pref insecure_minus_secure if bachelors == 0, $boots
est sto insecure_minus_secure_0
reg benefit_pref insecure_minus_secure if bachelors == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in UI Benefits) legend(off)
graph export "SI-fig6b.pdf", as(pdf) replace // Note: Circle: NO BACHELORS, Triangle: BACHELORS OR HIGHER.
* ---------------------------


* ----- FIGURE 6c ------------
est clear
* For change in duration eligibility:
* diff = mean(Secure T) - mean(Control) 
reg duration_pref secure_minus_control if bachelors == 0, $boots
est sto secure_minus_control_0
reg duration_pref secure_minus_control if bachelors == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg duration_pref insecure_minus_control if bachelors == 0, $boots
est sto insecure_minus_control_0
reg duration_pref insecure_minus_control if bachelors == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg duration_pref insecure_minus_secure if bachelors == 0, $boots
est sto insecure_minus_secure_0
reg duration_pref insecure_minus_secure if bachelors == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Duration Eligibility) legend(off)
graph export "SI-fig6c.pdf", as(pdf) replace // Note: Circle: NO BACHELORS, Triangle: BACHELORS OR HIGHER.
* ---------------------------


* ----- FIGURE 6d ------------
est clear
* For change in restrictiveness eligibility:
* diff = mean(Secure T) - mean(Control) 
reg strict_pref secure_minus_control if bachelors == 0, $boots
est sto secure_minus_control_0
reg strict_pref secure_minus_control if bachelors == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg strict_pref insecure_minus_control if bachelors == 0, $boots
est sto insecure_minus_control_0
reg strict_pref insecure_minus_control if bachelors == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg strict_pref insecure_minus_secure if bachelors == 0, $boots
est sto insecure_minus_secure_0
reg strict_pref insecure_minus_secure if bachelors == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Restrictiveness Eligibility) legend(off)
graph export "SI-fig6d.pdf", as(pdf) replace // Note: Circle: NO BACHELORS, Triangle: BACHELORS OR HIGHER.
* ---------------------------



* ----- FIGURE 7a ------------
est clear
* diff = mean(Secure T) - mean(Control) 
reg jobinsecurity secure_minus_control if minority == 0, $boots
est sto secure_minus_control_0
reg jobinsecurity secure_minus_control if minority == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg jobinsecurity insecure_minus_control if minority == 0, $boots
est sto insecure_minus_control_0
reg jobinsecurity insecure_minus_control if minority == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg jobinsecurity insecure_minus_secure if minority == 0, $boots
est sto insecure_minus_secure_0
reg jobinsecurity insecure_minus_secure if minority == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Job Insecurity) legend(off)
graph export "SI-fig7a.pdf", as(pdf) replace // Note: Circle: WHITE, Triangle: NON-WHITE.
* ---------------------------


* ----- FIGURE 7b ------------
est clear
* For change in UI benefits:
* diff = mean(Secure T) - mean(Control) 
reg benefit_pref secure_minus_control if minority == 0, $boots
est sto secure_minus_control_0
reg benefit_pref secure_minus_control if minority == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg benefit_pref insecure_minus_control if minority == 0, $boots
est sto insecure_minus_control_0
reg benefit_pref insecure_minus_control if minority == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg benefit_pref insecure_minus_secure if minority == 0, $boots
est sto insecure_minus_secure_0
reg benefit_pref insecure_minus_secure if minority == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in UI Benefits) legend(off)
graph export "SI-fig7b.pdf", as(pdf) replace // Note: Circle: WHITE, Triangle: NON-WHITE.
* ---------------------------


* ----- FIGURE 7c ------------
est clear
* For change in duration eligibility:
* diff = mean(Secure T) - mean(Control) 
reg duration_pref secure_minus_control if minority == 0, $boots
est sto secure_minus_control_0
reg duration_pref secure_minus_control if minority == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg duration_pref insecure_minus_control if minority == 0, $boots
est sto insecure_minus_control_0
reg duration_pref insecure_minus_control if minority == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg duration_pref insecure_minus_secure if minority == 0, $boots
est sto insecure_minus_secure_0
reg duration_pref insecure_minus_secure if minority == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Duration Eligibility) legend(off)
graph export "SI-fig7c.pdf", as(pdf) replace // Note: Circle: WHITE, Triangle: NON-WHITE.
* ---------------------------


* ----- FIGURE 7d ------------
est clear
* For change in restrictiveness eligibility:
* diff = mean(Secure T) - mean(Control) 
reg strict_pref secure_minus_control if minority == 0, $boots
est sto secure_minus_control_0
reg strict_pref secure_minus_control if minority == 1, $boots
est sto secure_minus_control_1

* diff = mean(Insecure) - mean(Control) 
reg strict_pref insecure_minus_control if minority == 0, $boots
est sto insecure_minus_control_0
reg strict_pref insecure_minus_control if minority == 1, $boots
est sto insecure_minus_control_1

* diff = mean(Insecure) - mean(Secure T)
reg strict_pref insecure_minus_secure if minority == 0, $boots
est sto insecure_minus_secure_0
reg strict_pref insecure_minus_secure if minority == 1, $boots
est sto insecure_minus_secure_1

* PLOT
coefplot (secure_minus_control_0, $gstyle1) ///
	(secure_minus_control_1, $gstyle2) ///
	(insecure_minus_control_0, $gstyle1) ///
	(insecure_minus_control_1, $gstyle2) ///
	(insecure_minus_secure_0, $gstyle1) ///
	(insecure_minus_secure_1, $gstyle2), ///
	drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Change in Restrictiveness Eligibility) legend(off)
graph export "SI-fig7d.pdf", as(pdf) replace // Note: Circle: WHITE, Triangle: NON-WHITE.
* ---------------------------


* -------- TABLE 2 ----------
est clear
eststo: reg jobinsecurity secure_minus_control female age republican democrat minority discountrate riskacceptance educ, $boots // secure relative to control
eststo: reg jobinsecurity insecure_minus_control female age republican democrat minority discountrate riskacceptance educ, $boots // insecure relative to control
eststo: reg jobinsecurity insecure_minus_secure female age republican democrat minority discountrate riskacceptance educ, $boots // insecure relative to secure
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------


* -------- TABLE 3 ----------
est clear
eststo: reg benefit_pref secure_minus_control female age republican democrat minority discountrate riskacceptance educ, $boots // secure relative to control
eststo: reg benefit_pref insecure_minus_control female age republican democrat minority discountrate riskacceptance educ, $boots // insecure relative to control
eststo: reg benefit_pref insecure_minus_secure female age republican democrat minority discountrate riskacceptance educ, $boots // insecure relative to secure
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------

* -------- TABLE 4 ----------
est clear
eststo: reg duration_pref secure_minus_control female age republican democrat minority discountrate riskacceptance educ, $boots // secure relative to control
eststo: reg duration_pref insecure_minus_control female age republican democrat minority discountrate riskacceptance educ, $boots // insecure relative to control
eststo: reg duration_pref insecure_minus_secure female age republican democrat minority discountrate riskacceptance educ, $boots // insecure relative to secure
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------


* -------- TABLE 5 ----------
est clear
eststo: reg strict_pref secure_minus_control female age republican democrat minority discountrate riskacceptance educ, $boots // secure relative to control
eststo: reg strict_pref insecure_minus_control female age republican democrat minority discountrate riskacceptance educ, $boots // insecure relative to control
eststo: reg strict_pref insecure_minus_secure female age republican democrat minority discountrate riskacceptance educ, $boots // insecure relative to secure
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------


* -------- TABLE 6 ----------
est clear
eststo: ologit benefit_rank i.CUB4P05_wording
test 2.CUB4P05_wording = 3.CUB4P05_wording

eststo: ologit duration_rank i.CUB4P05_wording
test 2.CUB4P05_wording = 3.CUB4P05_wording

eststo: ologit strict_rank i.CUB4P05_wording
test 2.CUB4P05_wording = 3.CUB4P05_wording

eststo: ologit cost_rank i.CUB4P05_wording
test 2.CUB4P05_wording = 3.CUB4P05_wording
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------



* -------- FIGURE 8 ----------
est clear
* Benefit generosity support
reg benefit_pref i.CUB4P05_wording##c.discountrate, $boots
est store benefits
* Duration support
reg duration_pref i.CUB4P05_wording##c.discountrate, $boots
est store duration
* Strictness support		
reg strict_pref i.CUB4P05_wording##c.discountrate, $boots
est store strictness
		
coefplot (benefits) ///
	(duration) ///
	(strictness) , drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Coefficient) 
graph export "SI-fig8.pdf", as(pdf) replace
* ---------------------------



* -------- TABLE 7 ----------
est clear
eststo: ologit benefit_rank i.CUB4P05_wording##c.discountrate
eststo: ologit duration_rank i.CUB4P05_wording##c.discountrate
eststo: ologit strict_rank i.CUB4P05_wording##c.discountrate
eststo: ologit cost_rank i.CUB4P05_wording##c.discountrate
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------


* -------- FIGURE 9 ----------
est clear
* Benefit generosity support
reg benefit_pref i.CUB4P05_wording##c.riskacceptance, $boots 
est store benefits
* Duration support
reg duration_pref i.CUB4P05_wording##c.riskacceptance, $boots
est store duration
* Strictness support		
reg strict_pref i.CUB4P05_wording##c.riskacceptance, $boots
est store strictness
		
coefplot (benefits) ///
	(duration) ///
	(strictness), drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Coefficient)  
graph export "SI-fig9.pdf", as(pdf) replace
* ---------------------------


* -------- TABLE 8 ----------
est clear
eststo: ologit benefit_rank i.CUB4P05_wording##c.riskacceptance 
eststo: ologit duration_rank i.CUB4P05_wording##c.riskacceptance
eststo: ologit strict_rank i.CUB4P05_wording##c.riskacceptance
eststo: ologit cost_rank i.CUB4P05_wording##c.riskacceptance
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------


* -------- TABLE 9 ----------
est clear
eststo: ologit benefit_rank jobinsecurity 
eststo: ologit duration_rank jobinsecurity
eststo: ologit strict_rank jobinsecurity
eststo: ologit cost_rank jobinsecurity
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------


* -------- FIGURE 10 ----------
est clear
* Benefit generosity support
reg benefit_pref jobinsecurity, $boots 
est store benefits
* Duration support
reg duration_pref jobinsecurity, $boots
est store duration
* Strictness support		
reg strict_pref jobinsecurity, $boots
est store strictness
		
coefplot (benefits) ///
	(duration) ///
	(strictness), drop(_cons) xscale(range(0 .3)) xline(0, lcolor(black) lpattern(solid)) xtitle(Coefficient) 
graph export "SI-fig10.pdf", as(pdf) replace
* ---------------------------


* -------- FIGURE 11 ----------
est clear
* Benefit generosity support
reg benefit_pref riskacceptance, $boots 
est store benefits
* Duration support
reg duration_pref riskacceptance, $boots
est store duration
* Strictness support		
reg strict_pref riskacceptance, $boots
est store strictness
		
coefplot (benefits) ///
	(duration) ///
	(strictness), drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Coefficient)
graph export "SI-fig11.pdf", as(pdf) replace
* ---------------------------


* -------- TABLE 10 ----------
est clear
eststo: ologit benefit_rank riskacceptance 
eststo: ologit duration_rank riskacceptance
eststo: ologit strict_rank riskacceptance
eststo: ologit cost_rank riskacceptance
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------


* -------- FIGURE 12 ----------
est clear
* Benefit generosity support
reg benefit_pref discountrate, $boots 
est store benefits
* Duration support
reg duration_pref discountrate, $boots
est store duration
* Strictness support		
reg strict_pref discountrate, $boots
est store strictness
		
coefplot (benefits) ///
	(duration) ///
	(strictness), drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Coefficient) xscale(range(0 .2)) 
graph export "SI-fig12.pdf", as(pdf) replace
* ---------------------------


* -------- TABLE 11 ----------
est clear
eststo: ologit benefit_rank discountrate 
eststo: ologit duration_rank discountrate
eststo: ologit strict_rank discountrate
eststo: ologit cost_rank discountrate
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------


* -------- TABLE 12 ----------
est clear
eststo: ologit benefit_rank altruism 
eststo: ologit duration_rank altruism
eststo: ologit strict_rank altruism
eststo: ologit cost_rank altruism
estout using tab1.tex, replace style(tex) cells("b(star fmt(3)) se(par fmt(3))") 
* ---------------------------


* -------- FIGURE 13 ----------
est clear
* Benefit generosity support
reg benefit_pref altruism, $boots
est store benefits
* Duration support
reg duration_pref altruism, $boots
est store duration
* Strictness support		
reg strict_pref altruism, $boots
est store strictness
		
coefplot (benefits) ///
	(duration) ///
	(strictness), drop(_cons) xline(0, lcolor(black) lpattern(solid)) xtitle(Coefficient) xscale(range(0 .2)) 
graph export "SI-fig13.pdf", as(pdf) replace
* ---------------------------



